1. Field of the Invention
The present invention relates to a data processor, and more specifically to a microcomputer capable of processing a processing request from various peripheral devices and internal circuits in different interrupt processing modes in accordance with the type of the requested processing.
2. Description of related art
Recent advancements in semiconductor technology have realized one microcomputer formed on a single semiconductor chip. In addition, various peripheral devices and internal circuits such as a timer counter, an analog/digital converter, and a serial transmission/reception circuit have been developed, and are provided to the microcomputer in an actual use, so that a high level of function is realized. As a result, a central processing unit (called "CPU" hereinafter) are required not only to execute data processing in accordance with a designated program at a high speed, but also to effectively and speedily comply with a processing request from the peripheral devices and internal circuits.
Heretofore, a processing called "interrupt" has been widely adopted to allow the CPU to effectively process the operation requests from internal circuits and peripheral devices. In the interrupt, if the CPU detects a processing request from a peripheral device or the like, the current sequence of program is temporarily suspended, and a sequence appropriate to the interrupt request is exectued.
In general, it is frequently required that certain specific processing is preferentially exectued as compared with other processings without regard to the current program being exectued by the CPU. Such interrupt requests will occur at random. Therefore, the CPU is adapted to check, at a final machine cycle of each instruction execution cycle, whether or not an interrupt request is generated. If the interrupt request is detected, the CPU interrupts the processing of the current program being executed, and starts the interrupt processing. At this time, the contents of a program counter, flags and various registers are saved to a stack, so that the status of the interrupted program is preserved without being broken. After completion of the interrupt processing, the saved information is restored to the original counter, flags and registers, so that the suspended program is restarted.
Further, in the case that a plurality of interrupt processing requests should be handled, a vector interrupt method has been used. In this method, in order to select one program appropriate to an interrupt request from among a plurality of interrupt processing programs, selection data or vectors are respectively assigned to peripheral devices and an interrupt request circuit. The interrupt vectors specify a head address of respective interrupt routines held in a program memory. Therefore, a branch destination address is determined on the basis of the vector value supplied after the interrupt request, so that the operation is branched to the interrupt processing routine.
In addition, in some cases it is necessary to inhibit an acknowledge of interrupt request in view of a current processing being executed. For example, one case is that a processing for another interrupt is being executed. Another case is that a stack should be avoided from being further deepened. A third case is that the content of a stack is being handled under a direct instruction. In order to comply with such situations, there is provided an interrupt enable flag (called "EI flag" hereinafter) which is set when an interrupt processing can be allowed and is reset when an interrupt processing is already being executed or when an interrupt should be inhibited. In ordinary cases, this EI flag is adapted to be automatically reset in a hardware manner when an interrupt processing is started, and therefore, should be set in the course of a restoring processing from the interrupt processing.
In the above mentioned interrupt processing, in order to ensure the return to the original program being executed before the start of an interrupt, it is inevitably required to execute the saving of various registers before the start of interrupt, the resetting of the EI flag, the branching to the interrupt processing program, the restoring of the saved information after the completion of interrupt, and the setting of the EI flag. In other words, a large amount of overhead including the above specified processings is required other than the processing of a required interrupt processing program.
Further, in the course of execution of a vector interrupt processing program, even if there is generated a request of a simple processing such as a date transfer between a memory and a peripheral device, it cannot be handled because of the limit of a stack area.
In view of the above, in various microcomputer application systems receiving a number of different processing requests from a plurality of processing request generation sources for a short time period, the requested processings could not be executed effectively at a high speed.